import os
import torch

# Elasticsearch配置
ES_HOST = "http://10.131.3.253:9200"
INDEX_NAME = "patents"
VEC_FIELD = "bge_zh_768"

# 项目根目录
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# 嵌入模型配置 - 使用相对路径
EMBED_MODEL_PATH = os.path.join(BASE_DIR, "BAAI-bge-base-zh-v1.5")

# 自动检测设备：有CUDA就用CUDA，没有就用CPU
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"

# LLM配置
LLM_KEY = "sk-LHeCEe1pWJNhiHUI031cF20c267c4eA98f822eFe91C5De9b"
LLM_BASE = "https://deepseek.fosu.edu.cn/v1"
LLM_MODEL = "deepseek-r1-70b"

# 搜索配置
TOP_N = 1000
RRF_K = 60

# 环境变量设置
os.environ["TRANSFORMERS_OFFLINE"] = "1"
os.environ["HF_HUB_OFFLINE"] = "1"
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
